﻿#include "authorityservice.h"

#include <coredatabase.h>

AuthorityService::AuthorityService(QObject *parent) : QObject(parent)
{
    db = CoreDatabase::getInstance()->getConnection();
}

AuthorityService::~AuthorityService()
{
    CoreDatabase::getInstance()->releaseConnection(db);
}

bool AuthorityService::getList(QList<Authority> &list)
{
    AuthorityDao authorityDao(db);
    return authorityDao.getList(list);
}

bool AuthorityService::getOne(Authority &object)
{
    AuthorityDao authorityDao(db);
    return authorityDao.getOne(object);
}

bool AuthorityService::saveOne(Authority &object)
{
    AuthorityDao authorityDao(db);
    return authorityDao.saveOne(object);
}

bool AuthorityService::deleteOne(Authority &object)
{
    AuthorityDao authorityDao(db);
    return authorityDao.deleteOne(object);
}
